class Tab{
    constructor(el){
        this.el = document.querySelector(el)
        this.init()
    }
    init() {
        this.titleOver()
    }
    titleOver() {
        let ulLiObjs = this.el.querySelectorAll('ul li')
        ulLiObjs.forEach((item, i) => {
            item.onmouseover = () => { 
                this.tbTitle(ulLiObjs, i)
                this.tbContent(i)
            }
        })
    }
    tbTitle(ulLiObjs, i) {
        this.el.querySelector('ul li.active').className = ''
        ulLiObjs[i].className = 'active'
    }
    tbContent(i) {
        this.el.querySelector('ol li.active').className = ''
        let olLiObjs = this.el.querySelectorAll('ol li')
        olLiObjs[i].className = 'active'
    }
}

